Skip to content

rebase#94

Open
Abhinavpv28 wants to merge 79 commits intofeature/checkfrom
develop
Open

rebase#94
Abhinavpv28 wants to merge 79 commits intofeature/checkfrom
develop

Conversation

@Abhinavpv28
Copy link
Copy Markdown
Contributor

No description provided.

…orms (#88)

* Update rrdDynamic.c

* Update rrdDynamic.c

* Update rrdEventProcess.c

* Update rrdInterface.c
@Abhinavpv28 Abhinavpv28 requested a review from a team as a code owner March 8, 2025 06:13
@Abhinavpv28 Abhinavpv28 requested a review from a team March 8, 2025 06:13
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 8, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
11 out of 13 committers have signed the CLA.

✅ nhanasi
✅ scthunderbolt
✅ santoshcomcast
✅ Abhinavpv28
✅ madhubabutt
✅ Saranya2421
✅ AravindanNC
✅ Alan-Ryan
✅ sbarre01
✅ Vismalskumar0
✅ venkat0557
❌ Saranya
❌ naveenkumarhanasi


Saranya seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

scthunderbolt and others added 26 commits March 13, 2025 11:08
…102)

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdCommandSanity.c

* Update rrdJsonParser.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdMain.c

* Update rrdEventProcess.c

* Update rrdInterface.c

* Update rrdEventProcess.c
* RDK-55702: Update the MW clients to use Power Manager Plugin

Reason for change: Update the MW clients to use Power Manager Plugin with retry
Test Procedure: Refer RDK-55702
Risks: Low
Signed-off-by:gsanto722 grandhi_santoshkumar@comcast.com

* RDK-55702: Update the MW clients to use Power Manager Plugin

Reason for change: Update the MW clients to use Power Manager Plugin
Test Procedure: Refer RDK-55702
Risks: Low
Signed-off-by:gsanto722 grandhi_santoshkumar@comcast.com

* RDK-55702: Update the MW clients to use Power Manager Plugin

Reason for change: Update the MW clients to use Power Manager Plugin
Test Procedure: Refer RDK-55702
Risks: Low
Signed-off-by:gsanto722 grandhi_santoshkumar@comcast.com

* RDK-55702: Update the MW clients to use Power Manager Plugin

Reason for change: Update the MW clients to use Power Manager Plugin
Test Procedure: Refer RDK-55702
Risks: Low
Signed-off-by:gsanto722 grandhi_santoshkumar@comcast.com

* RDK-55702: Update the MW clients to use Power Manager Plugin

Reason for change: Update the MW clients to use Power Manager Plugin
Test Procedure: Refer RDK-55702
Risks: Low
Signed-off-by:gsanto722 grandhi_santoshkumar@comcast.com

* RDK-55702: Update the MW clients to use Power Manager Plugin

Reason for change: Update the MW clients to use Power Manager Plugin
Test Procedure: Refer RDK-55702
Risks: Low
Signed-off-by:gsanto722 grandhi_santoshkumar@comcast.com

---------

Co-authored-by: nhanasi <navihansi@gmail.com>
Merge changes related to L1, L2 workflow and Iarmbus plugin changes
)

Co-authored-by: mtirum011 <madhubabu_tirumala@comcast.com>
Co-authored-by: nhanasi <navihansi@gmail.com>
It should not be needed with registry being opensourced
RDKECMF-219 Enable component build workflow on Pull Request and remove unnecessary token
Copilot AI review requested due to automatic review settings December 4, 2025 23:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR appears to be a rebase that includes:

  • Enhanced functional test coverage for dynamic profile handling, deep sleep scenarios, and append operations
  • Improvements to PID handling in single instance tests
  • New test infrastructure for dynamic profiles with subcategory and harmful command detection
  • Unit test updates to support RBus API integration and PowerManager plugin support
  • Documentation additions including requirements, design documents, and sequence diagrams for uploadRRDLogs
  • Build system updates to support L2 testing and remove deprecated dependencies
  • Source code improvements including memory leak fixes, null pointer checks, and CPU-aware priority management

Reviewed changes

Copilot reviewed 50 out of 50 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
test/functional-tests/tests/test_rrd_single_instance.py Improved PID handling to support multiple PIDs and better validation
test/functional-tests/tests/test_rrd_dynamic_subcategory_report.py New test for dynamic profile subcategory handling
test/functional-tests/tests/test_rrd_dynamic_profile_report.py New test for complete dynamic profile processing
test/functional-tests/tests/test_rrd_dynamic_profile_missing_report.py New test for missing dynamic profile scenarios
test/functional-tests/tests/test_rrd_dynamic_profile_harmful_report.py New test for harmful command detection
test/functional-tests/tests/test_rrd_deepsleep_static_report.py New test for deep sleep static report scenarios
test/functional-tests/tests/test_rrd_append_report.py New test for append request handling
test/functional-tests/tests/test_rrd_append_dynamic_profile_static_notfound.py New test for append with missing static profile
test/functional-tests/tests/power_controller.h New header for PowerController API definitions
test/functional-tests/tests/helper_functions.py Added constants for dynamic testing
test/functional-tests/tests/deepsleep_main.c New test executable for deep sleep event handling
test/functional-tests/tests/create_json.sh New script for dynamic JSON profile creation
test/functional-tests/tests/Makefile New makefile for test executable compilation
src/unittest/rrdUnitTestRunner.cpp Updated unit tests for RBus API and power manager integration
src/unittest/mocks/pwrMgr.h New mock header for power manager API
src/unittest/mocks/Client_Mock.h Updated mocks to support RBus get operation
src/unittest/mocks/Client_Mock.cpp Implemented RBus get mock function
src/rrdRunCmdThread.c Added RemainAfterExit flag and conditional compilation guards
src/rrdMain.c Minor formatting change
src/rrdJsonParser.c Fixed resource leak and added null checks
src/rrdInterface.h Updated for PowerManager plugin support
src/rrdInterface.c Added RBus API integration and improved event handling
src/rrdIarmEvents.c Added PowerManager plugin support with threading
src/rrdEventProcess.c Added memory safety improvements and null checks
src/rrdDynamic.c Fixed string copy buffer overflow
src/rrdCommon.h Added conditional power_controller.h include
src/rrdCommandSanity.c Improved command sanitization with quote and whitespace handling
remote_debugger.json Added DeepSleep configuration
docs/uploadRRDLogs_*.md New comprehensive documentation for uploadRRDLogs migration
run_l2.sh Added new test cases and directory setup
cov_build.sh Updated build flags and removed deprecated include
configure.ac Added L2 support configuration option
.github/workflows/*.yml Updated CI/CD workflows

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

DEBUG_FILE = "Adding Details of Debug commands to Output File"
assert DEBUG_FILE in grep_rrdlogs(DEBUG_FILE)

issue_string = "DEEPSLEEP"
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable issue_string is not used.

Copilot uses AI. Check for mistakes.
DYNAMIC_JSONFILE = "Reading json config file /media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json"
assert DYNAMIC_JSONFILE in grep_rrdlogs(DYNAMIC_JSONFILE)

PARSE_SUCCESS = "Dynamic Profile Parse And Read Success..."
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable PARSE_SUCCESS is not used.

Copilot uses AI. Check for mistakes.
##########################################################################

import json
from helper_functions import *
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import pollutes the enclosing namespace, as the imported module helper_functions does not define 'all'.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,134 @@
import json
from helper_functions import *
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import pollutes the enclosing namespace, as the imported module helper_functions does not define 'all'.

Copilot uses AI. Check for mistakes.
# limitations under the License.
##########################################################################

from helper_functions import *
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import pollutes the enclosing namespace, as the imported module helper_functions does not define 'all'.

Copilot uses AI. Check for mistakes.
# limitations under the License.
##########################################################################

import json
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'json' is not used.

Copilot uses AI. Check for mistakes.
# limitations under the License.
##########################################################################

import json
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'json' is not used.

Copilot uses AI. Check for mistakes.
# limitations under the License.
##########################################################################

import json
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'json' is not used.

Copilot uses AI. Check for mistakes.
# limitations under the License.
##########################################################################

import json
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'json' is not used.

Copilot uses AI. Check for mistakes.
# limitations under the License.
##########################################################################

import json
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'json' is not used.

Copilot uses AI. Check for mistakes.
Vismalskumar0 and others added 2 commits January 12, 2026 13:55
* RDK-58172: integrate dcm-agent uploadstblogs and cleanup logging; update Makefile and upload flow

* Add unit tests for RRD upload orchestration

This file contains unit tests for the RRD upload orchestration, covering various aspects such as configuration loading, system information retrieval, log directory validation, and the entire upload workflow.

* Update Makefile.am

* Remove uploadRRDLogs program from Makefile

* Refactor uploadDebugoutput to use upload API

Updated the uploadDebugoutput function to call the upload API instead of executing a script. Enhanced logging for upload orchestration success and failure.

* Refactor upload orchestration into rrd_upload_orchestrate

Refactor upload orchestration logic into a separate function and remove deprecated main function.

* Update rrd_config.h

* Include common_device_api.h in rrd_sysinfo.h

Added inclusion of common_device_api.h for device API access.

* Add comprehensive functional tests for C API upload orchestration

- Add BDD feature file with 20 test scenarios for rrd_upload_orchestrate
- Add Python test implementation with 14 test functions
- Test coverage includes:
  * Valid and invalid parameter handling
  * Configuration loading from multiple sources (properties, RFC, DCM)
  * MAC address retrieval and timestamp generation
  * Issue type sanitization and normalization
  * Archive creation and format validation
  * Upload execution and lock handling
  * Cleanup operations
  * Error code propagation (codes 1-11)
  * Comprehensive logging verification
  * Integration with uploadDebugoutput wrapper

- Tests validate the complete flow from event trigger through C API
  execution to upload completion
- Helper class provides utilities for test setup, archive validation,
  and log verification

Refactor source validation and log handling. Improve error handling for directory operations and add functionality to move live logs.

* Refactor log upload handling and cleanup process
Updated log upload process to handle LOGUPLOAD_ENABLE case and adjusted archive creation and upload paths.
* RDKEMW-12334-The log entries in remote-debugger.log 

RDKEMW-12334-The log entries in remote-debugger.log differ between C binary files and script files when compared

* Change the log from Debug to Info
* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 21, 2026 19:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 74 out of 74 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if '.' in ISSUE_STRING:
ISSUE_NODE, ISSUE_SUBNODE = ISSUE_STRING.split('.')
else:
node = ISSUE_STRING
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable node is not used.

Copilot uses AI. Check for mistakes.
ISSUE_NODE, ISSUE_SUBNODE = ISSUE_STRING.split('.')
else:
node = ISSUE_STRING
subnode = None
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable subnode is not used.

Copilot uses AI. Check for mistakes.
node = ISSUE_STRING
subnode = None

ISSUE_FOUND = f"Issue Data Node: {ISSUE_NODE} and Sub-Node: {ISSUE_SUBNODE} found in Static JSON File /etc/rrd/remote_debugger.json"
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable ISSUE_FOUND is not used.

Copilot uses AI. Check for mistakes.
# limitations under the License.
##########################################################################

from helper_functions import *
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import pollutes the enclosing namespace, as the imported module helper_functions does not define 'all'.

Copilot uses AI. Check for mistakes.
nhanasi and others added 4 commits January 22, 2026 19:45
…ode (#178)

* Update Makefile.am

* Update rrdExecuteScript.c

* Update rrd_upload.h

* Update Makefile.am

* Update Makefile.am

* Update Makefile.am

* Update Makefile.am

---------

Co-authored-by: nhanasi <navihansi@gmail.com>
Copilot AI review requested due to automatic review settings February 17, 2026 16:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 74 out of 74 changed files in this pull request and generated 4 comments.

Comment thread src/rrdCommandSanity.c
j--;
}
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Checking for \"%s\" string in Issue commands... \n",__FUNCTION__,__LINE__,checkcmd);
sanitystr = strstr(issuecmd,checkcmd);
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memory leak: The 'checkcmd' pointer is modified to skip the opening quote (line 139), but the original pointer allocated by cJSON_Print() is lost. When this memory needs to be freed later, you won't have the original pointer. Store the original pointer before modifying it, or use a different variable for the adjusted pointer.

Copilot uses AI. Check for mistakes.
Comment thread src/rrd_archive.c
Comment on lines +98 to +109
} else if (name_len <= 255) {
/* split into prefix and name */
size_t prefix_len = name_len - 100 - 1; /* leave room for null */
if (prefix_len > sizeof(hdr.prefix)) {
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s] File name too long: %s (length %zu)\n",
__FUNCTION__, name, name_len);
return -1;
}
strncpy(hdr.prefix, name, prefix_len);
hdr.prefix[prefix_len < sizeof(hdr.prefix) ? prefix_len : sizeof(hdr.prefix) - 1] = '\0';
strncpy(hdr.name, name + prefix_len + 1, sizeof(hdr.name) - 1);
hdr.name[sizeof(hdr.name) - 1] = '\0';
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential buffer overflow: When splitting the name into prefix and name, the calculation 'prefix_len = name_len - 100 - 1' may not correctly handle cases where the name needs to be split. This could lead to incorrect string operations. Additionally, after setting the prefix, copying to hdr.name uses 'name + prefix_len + 1' which might skip a character unintentionally.

Copilot uses AI. Check for mistakes.
Comment on lines +196 to +203
SCRIPT_SUCCESS = "Debug Information Report upload Failed"
SCRIPT_FAILURE = "Debug Information Report upload Success"
if SCRIPT_SUCCESS in grep_rrdlogs(SCRIPT_SUCCESS):
print("Script execution success")
elif SCRIPT_FAILURE in grep_rrdlogs(SCRIPT_FAILURE):
print("Script execution failed")
else:
print("Script execution not found in logs")
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic error in test: The variable names SCRIPT_SUCCESS and SCRIPT_FAILURE are swapped. The check for "Debug Information Report upload Failed" is stored in SCRIPT_SUCCESS, and "Debug Information Report upload Success" is in SCRIPT_FAILURE. This will cause incorrect test results.

Copilot uses AI. Check for mistakes.
Comment on lines +149 to +156
SCRIPT_SUCCESS = "Debug Information Report upload Failed"
SCRIPT_FAILURE = "Debug Information Report upload Success"
if SCRIPT_SUCCESS in grep_rrdlogs(SCRIPT_SUCCESS):
print("Script execution success")
elif SCRIPT_FAILURE in grep_rrdlogs(SCRIPT_FAILURE):
print("Script execution failed")
else:
print("Script execution not found in logs")
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same logic error: SCRIPT_SUCCESS and SCRIPT_FAILURE variable names are swapped, with "Failed" assigned to SUCCESS and "Success" assigned to FAILURE. This duplicates the error from test_rrd_dynamic_profile_report.py.

Copilot uses AI. Check for mistakes.
madhubabutt and others added 4 commits February 25, 2026 15:11
This pull request addresses Coverity defects in the RDK Remote Debugger Device Management code, focusing on fixing memory leaks, buffer overflows, and resource handling issues.

Changes:

Added NULL checks for memory allocations (malloc, strdup, fread) with proper error handling and resource cleanup
Fixed buffer overflow vulnerabilities by using correct size parameters in strncpy/strncat operations
Corrected file pointer closure to only occur when pointers are valid (v_secure_pclose moved inside if blocks)
Fixed memory management issues with rfcbuf allocations and ownership





Co-authored-by: mtirum011 <madhubabu_tirumala@comcast.com>
Remote Debugger 1.3.2 release
Copilot AI review requested due to automatic review settings March 20, 2026 19:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 74 out of 74 changed files in this pull request and generated 1 comment.

Comment thread src/rrdInterface.c
Comment on lines +233 to +238
issue =rbusValue_GetString(value, NULL);
char *dot_position = strchr(issue, '.'); // Find the first occurrence of '.'
if (dot_position != NULL)
{
*dot_position = '\0'; // Replace '.' with null terminator
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue is a const char* returned by rbusValue_GetString(), but the code modifies it in-place by replacing '.' with '\0'. This risks corrupting RBUS-managed memory and can crash/produce incorrect values. Copy the string into a writable buffer (e.g., strdup/snprintf into a local array), modify the copy, and keep the RBUS value immutable.

Copilot uses AI. Check for mistakes.
nhanasi and others added 2 commits April 10, 2026 14:32
* RDKEMW-16897: Add Agentic Support for the RRD

* Updated the instructions

---------

Co-authored-by: Hanasi <nhanas001c@cable.comcast.com>
…ile Data (#183)

* Update rrdInterface.h

Update rrdInterface.h

Update rrdInterface.c

Update rrdInterface.h

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Add helper functions for profile data processing

Added helper functions for profile data processing.

Update rrdInterface.c

Update rrdInterface.h

Update Client_Mock.h

Add mock implementations for RBusApiWrapper methods

Remove mock profile handler functions for GTEST

Removed mock implementations for profile handler functions when GTEST_ENABLE is defined.

Update Client_Mock.cpp

Update Client_Mock.h

Update rrdInterface.h

Update Makefile.am

Update src/rrdInterface.c

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Create profileTestValid.json

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Create profileTestInvalid.json

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Update rrdInterface.c

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdInterface.c

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

fix: add NULL guard to has_direct_commands to prevent crash on NULL input

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c84bc9e8-e1d2-4412-81d4-54eb9c67be5f

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Create test.py

Convert run_l2.sh to Python with RDK tests

Refactor run_l2.sh to Python and implement RDK Remote Debugger tests.

L2

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdInterface.c

fix: correct set_rbus_response to use real rbus API signatures

rbusValue_Init() returns rbusValue_t (not rbusError_t) and
rbusValue_SetString() returns void in the real rbus library, so
capturing their return values as rbusError_t caused a build error.

- Remove incorrect return-value capture from rbusValue_Init and
  rbusValue_SetString; check rbusValue != NULL after init instead
- Add NULL guard for prop parameter
- Update RRDProfileHandlerTest SetUp() mock so rbusValue_Init actually
  sets *value to a non-null pointer, keeping SetRbusResponse_ValidInput
  test passing

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/e887c84a-2e12-4903-9d59-2bd6f90e2527

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Update rrdInterface.c

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

fix: resolve Coverity dead code and add NULL guard to get_all_categories_json

- read_profile_json_file: split combined NULL check into two separate
  checks (file_size first, then filename) so *file_size is safely
  zeroed before the filename check; eliminates the ternary
  'filename ? filename : "(null)"' and the Coverity dead-code report
- get_all_categories_json: add early NULL guard for json parameter
  that returns an empty JSON object string to prevent crash when
  callers (including unit tests) pass NULL

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c686520e-0adf-4e7e-9915-9b9e4e8a74fd

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdInterface.c

Update rrdInterface.c

Update rrdUnitTestRunner.cpp

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

Update src/rrdInterface.c

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdInterface.c

Clean up comments in save_profile_category function

Removed comments explaining file opening flags.

RDKEMW-16897: Add Agentic Support for the RRD (#182)

* RDKEMW-16897: Add Agentic Support for the RRD

* Updated the instructions

---------

Co-authored-by: Hanasi <nhanas001c@cable.comcast.com>

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Rename test.py to test_rrd_profile_data.py

rrd

Update src/rrdInterface.c

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update src/rrdInterface.c

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

* Update rrdInterface.c

* Update rrdUnitTestRunner.cpp
Copilot AI review requested due to automatic review settings April 23, 2026 14:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 86 out of 92 changed files in this pull request and generated 15 comments.

Comment on lines +41 to +44
def reset_issuetype_rfc():
command = 'rbuscli set Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType string ""'
result = subprocess.run(command, shell=True, capture_output=True, text=True)
assert result.returncode == 0
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subprocess is used but not imported in this test module, so the test will fail at runtime (NameError). Add import subprocess at the top (matching the other test files using subprocess).

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +9
file_path = "/etc/rrd/remote_debugger.json"

# Read the existing JSON data
with open(file_path, "r") as json_file:
data = json.load(json_file)
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test module mutates /etc/rrd/remote_debugger.json at import time (during pytest collection), which is a high-risk side effect and can break other tests or the test environment. Move this logic into a test/fixture (e.g., setup step) and restore the original file in teardown, or write to an isolated temp path and point the component under test to that path.

Copilot uses AI. Check for mistakes.
}

# Update the JSON data with the new entry
data.update(new_entry)
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test module mutates /etc/rrd/remote_debugger.json at import time (during pytest collection), which is a high-risk side effect and can break other tests or the test environment. Move this logic into a test/fixture (e.g., setup step) and restore the original file in teardown, or write to an isolated temp path and point the component under test to that path.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +26
with open(file_path, "w") as json_file:
json.dump(data, json_file, indent=4)
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test module mutates /etc/rrd/remote_debugger.json at import time (during pytest collection), which is a high-risk side effect and can break other tests or the test environment. Move this logic into a test/fixture (e.g., setup step) and restore the original file in teardown, or write to an isolated temp path and point the component under test to that path.

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +24
#!/bin/bash

# Step 1: Create a JSON file
json_file="/media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json"
echo '{
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script writes to /media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json without ensuring the parent directory exists. If /media/apps/RDK-RRD-Test/etc/rrd is missing, the redirect will fail and downstream tests will fail when looking for the dynamic JSON. Create the directory (mkdir -p) before the echo > $json_file. Also, if this script is ever executed directly (not via bash script.sh), the shebang should be the first line of the file (currently preceded by the license header).

Copilot uses AI. Check for mistakes.
Comment thread src/unittest/Makefile.am

# Define the compiler flags
COMMON_CXXFLAGS = -frtti -fprofile-arcs -ftest-coverage
COMMON_CXXFLAGS = -frtti -fprofile-arcs -ftest-coverage -fpermissive
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding -fpermissive can mask real compile-time errors by downgrading them to warnings, which reduces the signal of the unit-test build and can allow UB-prone code to slip in. Prefer fixing the underlying compile issues and keeping the test build strict (or scope -fpermissive to only the specific translation unit that strictly requires it as a last resort).

Suggested change
COMMON_CXXFLAGS = -frtti -fprofile-arcs -ftest-coverage -fpermissive
COMMON_CXXFLAGS = -frtti -fprofile-arcs -ftest-coverage

Copilot uses AI. Check for mistakes.
Comment thread configure.ac
Comment on lines +65 to +76
AC_ARG_ENABLE([L2support],
AS_HELP_STRING([--enable-L2support],[enable L2support (default is no)]),
[
case "${enableval}" in
yes) L2_SUPPORT_ENABLE=true
L2_SUPPORT_FLAG="-DUSE_L2_SUPPORT"
m4_if(m4_sysval,[0],[SUBDIRS_L2_SUPPORT="src"]) ;;
no) L2_SUPPORT_ENABLE=false AC_MSG_ERROR([L2_SUPPORT is disabled]) ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-L2support]) ;;
esac
],
[echo "L2support is disabled"])
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing --enable-L2support=no currently hard-fails configure via AC_MSG_ERROR([L2_SUPPORT is disabled]). Typically no should simply disable the option and continue configuration. Consider removing the error for no and just setting the flag/conditionals accordingly.

Copilot uses AI. Check for mistakes.
Comment thread run_l2.sh
mkdir -p /media/apps/RDK-RRD-Test/etc/rrd

touch /media/apps/RDK-RRD-Test/etc/rrd/remote_debugger.json
echo "AA:BB:CC:DD:EE:FF" >> /tmp/.estb_mac
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appending (>>) the MAC to /tmp/.estb_mac can accumulate multiple lines across runs and produce ambiguous MAC reads. Use overwrite (>) or explicitly truncate the file before writing to keep the test environment deterministic.

Suggested change
echo "AA:BB:CC:DD:EE:FF" >> /tmp/.estb_mac
echo "AA:BB:CC:DD:EE:FF" > /tmp/.estb_mac

Copilot uses AI. Check for mistakes.
Comment on lines +43 to +55
When the remotedebugger read the json file form the dynamic path
Then remotedebugger json read and parse should be success
And remotedebugger should read the Issuetype from dynamic profile

Scenario: Check for harmfull commands and abort
Given remote debugger parse the Dynamic json profile successfully
When the issue node and subnode are present in the profile
Then the remote debugger should read the Sanity Check list from profile
And the remotedebugger should perform sanity check on issue commands
Given the remote debugger profile has the harmfull commands
When the issue command and the sanity commands are matched
Then the remote debugger should exit the processing of commands
And Abort the commmand execution and skip report upload
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct spelling in feature text to improve readability/searchability (e.g., “harmfull” → “harmful”, “commmand” → “command”).

Suggested change
When the remotedebugger read the json file form the dynamic path
Then remotedebugger json read and parse should be success
And remotedebugger should read the Issuetype from dynamic profile
Scenario: Check for harmfull commands and abort
Given remote debugger parse the Dynamic json profile successfully
When the issue node and subnode are present in the profile
Then the remote debugger should read the Sanity Check list from profile
And the remotedebugger should perform sanity check on issue commands
Given the remote debugger profile has the harmfull commands
When the issue command and the sanity commands are matched
Then the remote debugger should exit the processing of commands
And Abort the commmand execution and skip report upload
When the remotedebugger read the json file from the dynamic path
Then remotedebugger json read and parse should be success
And remotedebugger should read the Issuetype from dynamic profile
Scenario: Check for harmful commands and abort
Given remote debugger parse the Dynamic json profile successfully
When the issue node and subnode are present in the profile
Then the remote debugger should read the Sanity Check list from profile
And the remotedebugger should perform sanity check on issue commands
Given the remote debugger profile has the harmful commands
When the issue command and the sanity commands are matched
Then the remote debugger should exit the processing of commands
And Abort the command execution and skip report upload

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +55
Scenario: Check for harmfull commands and abort
Given remote debugger parse the Dynamic json profile successfully
When the issue node and subnode are present in the profile
Then the remote debugger should read the Sanity Check list from profile
And the remotedebugger should perform sanity check on issue commands
Given the remote debugger profile has the harmfull commands
When the issue command and the sanity commands are matched
Then the remote debugger should exit the processing of commands
And Abort the commmand execution and skip report upload
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct spelling in feature text to improve readability/searchability (e.g., “harmfull” → “harmful”, “commmand” → “command”).

Suggested change
Scenario: Check for harmfull commands and abort
Given remote debugger parse the Dynamic json profile successfully
When the issue node and subnode are present in the profile
Then the remote debugger should read the Sanity Check list from profile
And the remotedebugger should perform sanity check on issue commands
Given the remote debugger profile has the harmfull commands
When the issue command and the sanity commands are matched
Then the remote debugger should exit the processing of commands
And Abort the commmand execution and skip report upload
Scenario: Check for harmful commands and abort
Given remote debugger parse the Dynamic json profile successfully
When the issue node and subnode are present in the profile
Then the remote debugger should read the Sanity Check list from profile
And the remotedebugger should perform sanity check on issue commands
Given the remote debugger profile has the harmful commands
When the issue command and the sanity commands are matched
Then the remote debugger should exit the processing of commands
And Abort the command execution and skip report upload

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.